package com.itheima.mp.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.mp.domain.po.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {


    @Update("update user set balance=balance-#{amount} ${ew.customSqlSegment}")
    void updateBalanceByIds(@Param("ew") LambdaQueryWrapper<User> userLambdaQueryWrapper,@Param("amount") int amount);

    @Update("update user set balance=balance-#{money} ${ew.customSqlSegment}")
    void updateMoney (@Param("ew") LambdaQueryWrapper<User> wrapper,@Param("money") Integer money);
}
